﻿using Sabloane_de_proiectare.Command;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Shapes;

namespace Sabloane_de_proiectare.Flyweight
{
    class FlyweightConcrete : Flyweight
    {
        private Canvas target { get; set; }
        public FlyweightConcrete()
        {
            target = null;
        }
        public void addChildrens(ObservableCollection<Rectangle> lines)
        {

            if (target == null)
            {
                throw new Exception("Invalid canvas.");
            }
            else
            {
                for (int i = 0; i < lines.Count; i++)
                {
                    target.Children.Add(lines.ElementAt(i));
                }
            }
        }
    }
}
